const {cloud} = getApp();
Page({
  data: {
    tle:"活动列表",
    subTle:"列表详情",
    pageActive:0,      //显示控制
    pageNo:1,
    pageSize:2,
    pageData:[],

    dataSource:[
      {
        id:1,
        activeName:"多人拼图",
        activeTime:"2020-01-02 00:00:00",
        activeStatus:"1",       //1为进行中  0为已结束
        operation:[1,2,3,4]
      },
      {
        id:1,
        activeName:"多人拼图",
        activeTime:"2020-01-02 00:00:00",
        activeStatus:"0",       //1为进行中  0为已结束
        operation:[1,2,3,4]
      },
    ]
  },

  onPageChange(e){

    console.log(e.detail.value)
    this.setData({
      pageNo:e.detail.value
    })
    this.getAcitveList();

  },

  getAcitveList(){
    cloud.application.httpRequest({
      'path': `/api/b/getActionList`,
      'method': 'GET',
      'headers':{ "Content-Type":"application/json"},
      'params':{pageNo: this.data.pageNo, pageSize: this.data.pageSize },
      'body':{  },
    }).then(ress => {

      console.info("活动列表",ress);
      this.setData({ pageData: ress.data})
      
    })
  },

  // //编辑
  edit(e){
    
  },

  // //投放
  put(e){
    this.setData({
      pageActive:1
    })
  },

  // //数据
  activeData(){

  },

  // //删除
  del(){

  },

  onLoad() {
    
    //获取活动列表
    this.getAcitveList();
    

  },
});
